#include <iostream>
#include "krpc/localstream.h"
#include "krpc/subcribe.h"

int main(int argc, char **argv)
{
	if (argc != 2) {
		std::cerr << "please input 1 argument for topic!" << std::endl;
		return -1;
	}
	std::string topic = argv[1];
	KRPC::LOCALSTREAM com("msgcenter");
	KRPC::Subcribe<std::string> sub(topic, com, 3000);
	sub.run([](std::string data){
		std::cout << "data: " << data << std::endl;
	});
}